package com.group4.datafactorybackend.entity.DO;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 卑微小峰
 * @date 2022/8/13
 * @description 接口参数配置表实体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value ="api_paramter_configuration")
public class ApiParamterConfigurationDO implements Serializable {

    /**
     * 表ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 接口参数编号
     */
    @TableField("apc_code")
    private String apcCode;

    /**
     * 接口参数名称
     */
    @TableField("apc_name")
    private String apcName;

    /**
     * 接口参数位置
     */
    @TableField("apc_position")
    private Integer apcPosition;

    /**
     * 接口参数数据类型
     */
    @TableField("apc_data_type")
    private Integer apcDataType;

    /**
     * 接口数据是否必填
     */
    @TableField("apc_data_null")
    private Integer apcDataNull;

    /**
     * 接口参数取值
     */
    @TableField("apc_value")
    private String apcValue;

    /**
     * 接口参数描述
     */
    @TableField("apc_describe")
    private String apcDescribe;

    /**
     * 接口父级参数编号
     */
    @TableField("apc_parent_param_code")
    private String apcParentParamCode;

    /**
     * 接口编号
     */
    @TableField("api_code")
    private String apiCode;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ApiParamterConfigurationDO other = (ApiParamterConfigurationDO) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getApcCode() == null ? other.getApcCode() == null : this.getApcCode().equals(other.getApcCode()))
            && (this.getApcName() == null ? other.getApcName() == null : this.getApcName().equals(other.getApcName()))
            && (this.getApcPosition() == null ? other.getApcPosition() == null : this.getApcPosition().equals(other.getApcPosition()))
            && (this.getApcDataType() == null ? other.getApcDataType() == null : this.getApcDataType().equals(other.getApcDataType()))
            && (this.getApcDataNull() == null ? other.getApcDataNull() == null : this.getApcDataNull().equals(other.getApcDataNull()))
            && (this.getApcValue() == null ? other.getApcValue() == null : this.getApcValue().equals(other.getApcValue()))
            && (this.getApcDescribe() == null ? other.getApcDescribe() == null : this.getApcDescribe().equals(other.getApcDescribe()))
            && (this.getApcParentParamCode() == null ? other.getApcParentParamCode() == null : this.getApcParentParamCode().equals(other.getApcParentParamCode()))
            && (this.getApiCode() == null ? other.getApiCode() == null : this.getApiCode().equals(other.getApiCode()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getApcCode() == null) ? 0 : getApcCode().hashCode());
        result = prime * result + ((getApcName() == null) ? 0 : getApcName().hashCode());
        result = prime * result + ((getApcPosition() == null) ? 0 : getApcPosition().hashCode());
        result = prime * result + ((getApcDataType() == null) ? 0 : getApcDataType().hashCode());
        result = prime * result + ((getApcDataNull() == null) ? 0 : getApcDataNull().hashCode());
        result = prime * result + ((getApcValue() == null) ? 0 : getApcValue().hashCode());
        result = prime * result + ((getApcDescribe() == null) ? 0 : getApcDescribe().hashCode());
        result = prime * result + ((getApcParentParamCode() == null) ? 0 : getApcParentParamCode().hashCode());
        result = prime * result + ((getApiCode() == null) ? 0 : getApiCode().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", apcCode=").append(apcCode);
        sb.append(", apcName=").append(apcName);
        sb.append(", apcPosition=").append(apcPosition);
        sb.append(", apcDataType=").append(apcDataType);
        sb.append(", apcDataNull=").append(apcDataNull);
        sb.append(", apcValue=").append(apcValue);
        sb.append(", apcDescribe=").append(apcDescribe);
        sb.append(", apcParentParamCode=").append(apcParentParamCode);
        sb.append(", apiCode=").append(apiCode);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}